/*
 * Relay.h
 *
 *  Created on: 2012. 10. 15.
 *      Author: dalxx
 */
#include "PLCConfig.h"

#ifndef RELAY_H_
#define RELAY_H_

#include <Arduino.h>

namespace PLCLib {
//class BooleanCalculator;
class Relay {
protected:
	//static char relay_name_buffer[::RELAY_NAME_MEMSIZE];
	char* name;
	bool status;
	bool next_status;
public:
	Relay(const char* _name);
	virtual ~Relay();
	bool GetStatus();
	virtual bool CalculateNext()=0;
	void Commit();

	void WriteStatus(Stream& stream);
	friend class BooleanCalculator;
	friend class RelayOperator;
	friend class Output;
};

} /* namespace PLCLib */
#endif /* RELAY_H_ */

